-module(pt_update_sg_jie_suan_score_d106).
-include("pt.hrl").

-export([new/0,from_binary/1,to_binary/1,to_binary/2,get_id/0]).

get_id()-> 16#D106.

new()->#pt_update_sg_jie_suan_score{}.

from_binary(Binary) -> 
	{Binary1,Data1} = lib_protocol:from_binary(Binary,{list,score_list_from_binary}),
	{_Binary,Data2} = lib_protocol:from_binary(Binary1,uint8),
	#pt_update_sg_jie_suan_score{
		score_list = Data1,
		game_times = Data2
	}.

to_binary(Pt) -> to_binary(Pt,0).
to_binary(Pt,Seq) -> 
	Data1 = lib_protocol:to_binary(Pt#pt_update_sg_jie_suan_score.score_list,{list,score_list_to_binary}),
	Data2 = lib_protocol:to_binary(Pt#pt_update_sg_jie_suan_score.game_times,uint8),
	GetData = <<Data1/binary,Data2/binary>>,
	lib_protocol:make_pt(GetData,get_id(),Seq).

